using System;
using System.Collections.Generic;
using System.Dynamic;
using RimWorld;
using Verse;
using Verse.AI;

namespace RimZombieGirl
{
    public class InteractionWorker_ZombieSuppress : InteractionWorker
    {
        public override void Interacted(Pawn initiator, Pawn recipient, List<RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef, out LookTargets lookTargets)
        {
            letterText = null;
            letterLabel = null;
            letterDef = null;
            lookTargets = null;
            // SlaveRebellionUtility.IncrementInteractionSuppression
            IncrementZombieInteractionSuppression(initiator, recipient);
        }

        public static void IncrementZombieInteractionSuppression(Pawn initiator, Pawn recipient)
        {
            Need_Zombie_Suppress need;
            if (initiator != null && recipient != null && recipient.needs != null && recipient.needs.TryGetNeed(out need))
            {
                float statValue = initiator.GetStatValue(ZombieDefOf.RI_Zombie_Stat_SuppressSpeed);
                if (need == null)
                {
                    Log.Error("Need_Zombie_Suppress not found for " + recipient);
                    return;
                }

                // 补充镇压度
                need.CurLevel += statValue * 0.2f;
                if (need.CurLevel > need.MaxLevel)
                {
                    need.CurLevel = need.MaxLevel;
                }

            }
        }
    }
}